package com.tfswue.jqr.entity;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.List;

@Component  //将类交给spring管理
//主要作用是将配置文件中的属性值注入到该类中，参数使prefix指定的是前缀，父类
@ConfigurationProperties(prefix = "user")
@Data   //getter和setter
//@NoArgsConstructor  //自动生成无参构造
//@AllArgsConstructor //自动生成全参构造

public class UserTestYml {
    private Integer id;
    private String name;
    private List<String> address;
    private List<Grade> grades;
}
@Data
class Grade{
    private String subject;
    private Integer score;
}